-- 开发测试
local _G = GLOBAL
local i_util = require "libs/inpututil"


local index = 0
_G.node = {}

local function nodetest()
    index = index + 1
    local id_name = _G.TheWorld.topology and _G.TheWorld.topology.ids and _G.TheWorld.topology.ids[index]
    _G.node = _G.TheWorld.topology and _G.TheWorld.topology.nodes and _G.TheWorld.topology.nodes[index]
    local node = _G.node
    if not node then
        return print("无法到达", index)
    end
    local tagstr = "["..table.concat(node.tags or {}, ", ").."]"
    local x, y = node.x, node.y
    i_util:GoTo(x, y)
    print(index, id_name, tagstr, x, y)
end

_G.TheInput:AddKeyUpHandler(127, nodetest)
